package org.ben.birthday.twentybirthday.controller.page;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


/**
 * @Author: Ben
 * @Date: 2019/7/18 21:49
 */
@Controller
@Api(tags = "前台数据接口", value = "PageController")
public class PageController {

    private static final Logger logger = LoggerFactory.getLogger(PageController.class);

    /**
     * 主页数据接口
     * @return ModelAndView
     */
    @RequestMapping(value = "/")
    @ApiOperation(value = "主页数据接口",
            httpMethod = "GET", response = ModelAndView.class)
    public ModelAndView indexController(){
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.setViewName("index");
        logger.info("欢迎进入主页");
        return modelAndView;
    }

    /**
     * 时间线页面接口
     * @return ModelAndView
     */
    @RequestMapping(value = "/timeLine")
    @ApiOperation(value = "时间线页面数据接口",
            httpMethod = "GET", response = ModelAndView.class)
    public ModelAndView timeLineController(){
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.setViewName("timeLine");
        logger.info("欢迎进入时间线");
        return modelAndView;
    }


    /**
     * 挚友页面数据接口
     * @return ModelAndView
     */
    @RequestMapping(value = "/company")
    @ApiOperation(value = "挚友页面数据接口",
            httpMethod = "GET", response = ModelAndView.class)
    public ModelAndView companyController(){
            ModelAndView modelAndView=new ModelAndView();
            modelAndView.setViewName("company");
            logger.info("欢迎进入挚友界面");
            return modelAndView;
    }

    /**
     * 私人空间登录页面数据接口
     * @return ModelAndView
     */
    @RequestMapping(value = "/privateSpaceEnter")
    @ApiOperation(value = "私人空间登录页面数据接口",
            httpMethod = "GET", response = ModelAndView.class)
    public ModelAndView privateSpaceEnterController(){
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.setViewName("privateSpaceEnter");
        logger.info("欢迎进入私人空间登录页面");
        return modelAndView;

    }

    /**
     * 留言板登录页面数据接口
     * @return ModelAndView
     */
    @RequestMapping(value = "/messageBoard")
    @ApiOperation(value = "留言板登录页面数据接口",
            httpMethod = "GET", response = ModelAndView.class)
    public ModelAndView messageBoardController(){
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.setViewName("messageBoard");
        logger.info("欢迎进入留言板登录页面");
        return modelAndView;
    }

}
